
import  type { IBanner } from "../myTypes";
import service from "../utils/service";
import {get} from "./request"
import url from "./url";

// export const getBannersApi=()=>get("/admin/banner/list");
export const getBannersApi=()=>get(url.bannerList);

// 获取轮播图数据
export const getBannersApi2=()=>service.get(url.bannerList)

// 添加轮播图
export const addBannerApi=(data:IBanner)=>service({url:url.bannerAdd , method: "post",data})

// 删除轮播图
export const deleteBannerApi=(bannerid:string)=>service({url: "/admin/banner/delete",params: { bannerid }})


// 修改访问状态
interface IParams{
    bannerid:string,
     flag: boolean
}

export const changeFlagApi=(params:IParams)=>service({url:"/admin/banner/updateFlag",method: "post",data: params})
